From bda2696f29ad5af6dea0d3edad180a58dde6984a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 27 Jun 2017 19:35:43 +0200 Subject: [PATCH] stubdom: fix vtpm compilation on GCC-7 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit GCC-7 have -Wimplicit-fallthrough enabled with -Wextra. Add appropriate comment which both mute the warning and improve readibility. Signed-off-by: Marek Marczykowski-Górecki Acked-by: Wei Liu --- stubdom/Makefile | 1 + stubdom/vtpm-implicit-fallthrough.patch | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 stubdom/vtpm-implicit-fallthrough.patch diff --git a/stubdom/Makefile b/stubdom/Makefile index db01827070..5055e313d6 100644 --- a/stubdom/Makefile +++ b/stubdom/Makefile @@ -228,6 +228,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz patch -d $@ -p1 < vtpm-deepquote.patch patch -d $@ -p1 < vtpm-deepquote-anyloc.patch patch -d $@ -p1 < vtpm-cmake-Wextra.patch + patch -d $@ -p1 < vtpm-implicit-fallthrough.patch mkdir $@/build cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement" touch $@ diff --git a/stubdom/vtpm-implicit-fallthrough.patch b/stubdom/vtpm-implicit-fallthrough.patch new file mode 100644 index 0000000000..db97be552f --- /dev/null +++ b/stubdom/vtpm-implicit-fallthrough.patch @@ -0,0 +1,10 @@ +--- tpm_emulator-x86_64/tpm/tpm_cmd_handler.c.orig 2017-04-27 13:37:14.408000000 +0200 ++++ tpm_emulator-x86_64/tpm/tpm_cmd_handler.c 2017-04-27 13:39:53.585000000 +0200 +@@ -3397,6 +3397,7 @@ + sizeof(rsp->auth2->nonceOdd.nonce)); + tpm_hmac_update(&hmac, (BYTE*)&rsp->auth2->continueAuthSession, 1); + tpm_hmac_final(&hmac, rsp->auth2->auth); ++ /* fall-thru */ + case TPM_TAG_RSP_AUTH1_COMMAND: + tpm_hmac_init(&hmac, rsp->auth1->secret, sizeof(rsp->auth1->secret)); + tpm_hmac_update(&hmac, rsp->auth1->digest, sizeof(rsp->auth1->digest)); -- 2.30.2